<template>
    <div class="follow">
        <div v-title data-title="关注公众号">关注公众号</div>
        <div class="logo">
            <img :src="logo" alt="">
        </div>
       <img class="code" :src="img" alt="">
       <p class="tip">关注公众号不迷路</p>
       <div class="box">
            <p >联系电话：{{this.phone}}</p>
            <p @click="goShopping" class="goShopping">前往商城</p>
            <!-- <p @click="app">APP下载</p> -->
       </div>
       <div v-show="$store.state.show_download" style="width:100%;height:100%;position: fixed;left:0;top:0;">
        <down-load></down-load>   
      </div>
    </div>
    
</template>
<script>
import { Toast } from 'mint-ui';  
import downLoad from './children/downLoad'
    export default {
        name: 'follow',
        data() {
            return {
               img:require('@/assets/WxGZCode.jpg'),
               logo:require('@/assets/logo.png'),
               phone:'',
               
            }
        },
        methods:{
            goShopping(){
                this.$router.push('/home');
            },
            goGoods(){
                this.$router.push({
                  name:'product',
                  params:{
                      id:this.off,
                      status:1
                  }
                });
            },
             app(){
                var ua = window.navigator.userAgent.toLowerCase();
                if(ua.match(/MicroMessenger/i) == 'micromessenger'){
                    this.$store.state.show_download = true;
                }else{
                    var u = navigator.userAgent, app = navigator.appVersion;
                    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
                    var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
                    if (isAndroid) {
                       //这个是安卓操作系统
                       Toast('可能需要进入手机“文件管理”找到APP并安装');
                       window.open( "http://www.2tianqc.com/App/2tianqc_a.apk");
                    }
                    if (isIOS) {
                　　　　//这个是ios操作系统
                        Toast('请到苹果App Store搜索2天聚清');
                         window.open( "https://itunes.apple.com/cn/app/storybear/id1374901365");
                    } 
                }
                
                
            }
        },
        created(){
          this.axios.post(API_URL + 'Home/Index/getPhone').then((res) => {
                this.phone = res.data.data;
            }).catch((err) => {
                console.log(err);
            });

        },
        components:{
          downLoad
        }

    }
</script>
<style lang="less" scoped>
    .follow{
       position: relative;
       top: 0;
       left: 0;
       right: 0;
       bottom: 0;
       background: #fff;
       width: 100%;
       height: 100%;
       text-align: center;
       .logo{
           padding-top: .25rem;
           padding-bottom: .25rem;
           background-color:#ce0a14;
           img{
            width: 1.5rem;
            height: .5rem;
           }

       }
       .code{
           width: 3rem;
           height: 3rem;
           padding-top: 2rem;
       }
       .tip{
           padding-top:.1rem;
           font-size: .25rem;
       }
       .box{
           text-align: center;
           p{
              padding:.78rem;
              font-size:.35rem; 
              font-weight: 600;
           }
           .goShopping{
              font-size:.4rem;
              text-decoration: underline;
            }
       }
    }
</style>